package com.affectu.task;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

import org.jboss.seam.annotations.Name;

import com.affectu.common.base.EntityBase;
import com.affectu.user.User;

/**
 * 2008-8-25
 * 
 * @author daniel nathan
 */
@Entity
@Name("bid")
public class Bid extends EntityBase {

	private static final long serialVersionUID = -1059717865919031809L;

	private long price;

	private String attachment;

	private Status status;

	public enum Status {
		ONSHOW, ACCEPTED
	};

	@ManyToOne(cascade = CascadeType.PERSIST)
	@JoinColumn(name = "taskId", referencedColumnName = "id")
	private InnerTask belongToTask;

	@ManyToOne(cascade = CascadeType.PERSIST)
	@JoinColumn(name = "userId", referencedColumnName = "id")
	private User owner;

	public long getPrice() {
		return price;
	}

	public void setPrice(long price) {
		this.price = price;
	}

	public String getAttachment() {
		return attachment;
	}

	public void setAttachment(String attachment) {
		this.attachment = attachment;
	}

	public InnerTask getBelongToTask() {
		return belongToTask;
	}

	public void setBelongToTask(InnerTask belongToTask) {
		this.belongToTask = belongToTask;
	}

	public User getOwner() {
		return owner;
	}

	public void setOwner(User owner) {
		this.owner = owner;
	}

	public Status getStatus() {
		return status;
	}

	public void setStatus(Status status) {
		this.status = status;
	}

}
